#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""

@author ：chenzf
@date ：2024/4/22 下午4:55 
"""


def file_read(file_name):
    file = None
    try:
        file = open(file_name, 'r')
        while True:
            line = file.readline()
            if not line:
                break
            print(line)
    except NameError as e:
        print(e)
    finally:
        if file:
            file.close()

def file_append(file_name,content):
    file = None
    try:
        file = open(file_name, 'a',encoding='utf-8')
        file.write(content)
    except NameError as e:
        print(e)
    finally:
        if file:
            file.close()
